home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib9
/
v_11_07
/
1107103a
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1995-11-01
|
302 b
|
21 lines
// wc.cpp: Display word count
#include <iostream.h>
#include <stddef.h>
main()
{
const size_t BUFSIZ = 128;
char s[BUFSIZ];
size_t wc = 0;
while (cin >> s)
++wc;
cout << wc << '\n';
return 0;
}
// Output from the command "wc < wc.cpp"
// 35